Skip to content

refactor(voice): extract reusable Pocket primitives - #2467

Open
johnmatthewtennant wants to merge 1 commit into
block:jtennant/pocket-tts-2026-04from
johnmatthewtennant:jt/buzz-voice-refactor
Open

refactor(voice): extract reusable Pocket primitives#2467
johnmatthewtennant wants to merge 1 commit into
block:jtennant/pocket-tts-2026-04from
johnmatthewtennant:jt/buzz-voice-refactor

Conversation

@johnmatthewtennant

@johnmatthewtennant johnmatthewtennant commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Context

Pocket TTS lived inside the Desktop crate and could not be reused by other Buzz clients.

Summary

This relocates the existing implementation into crates/buzz-voice without changing its behavior:

Source Destination Relocation
desktop/src-tauri/src/huddle/pocket.rs crates/buzz-voice/src/pocket.rs The implementation is copied byte-for-byte. The source path becomes a compatibility re-export.
desktop/src-tauri/src/huddle/pocket_april.rs crates/buzz-voice/src/pocket_april.rs Whole-file 100% rename.
desktop/src-tauri/src/huddle/pocket_models.rs crates/buzz-voice/src/pocket_models.rs Whole-file 100% rename.

The remaining changes add the crate facade, manifests, lockfiles, workspace wiring, and test registration. Mobile linking, packaging, callback APIs, patched dependencies, native libraries, and models are not part of this PR.

Excluding generated lockfiles, logical line accounting pairs relocated source with its destination so Git's copy/rename detection does not hide it:

Category Lines Share
Byte-identical relocated implementation 1,236 93.4%
New or modified handwritten wiring 88 6.6%

Lines are counted as unchanged destination LOC for relocations and added/removed lines for the remaining handwritten changes.

Testing

  • Manually tested Desktop huddles; they still work.
  • buzz-voice tests, full CI, Docker builds, and DCO passed.

Reviewer-reproducible examples

Verify the relocation:

git diff-tree -r --summary --find-copies-harder -C100% \
  43361508c3de49a58672ebb4a1232a05c2e16e35 \
  b6daac775a33eaad35fa83114e1c69402bcb3e25
copy {desktop/src-tauri/src/huddle => crates/buzz-voice/src}/pocket.rs (100%)
rename {desktop/src-tauri/src/huddle => crates/buzz-voice/src}/pocket_april.rs (100%)
rename {desktop/src-tauri/src/huddle => crates/buzz-voice/src}/pocket_models.rs (100%)

Run the moved tests:

cargo test --locked -p buzz-voice --all-targets

@johnmatthewtennant johnmatthewtennant changed the title Extract reusable Buzz voice primitives refactor(voice): extract reusable Buzz voice primitives Jul 27, 2026
@johnmatthewtennant johnmatthewtennant changed the title refactor(voice): extract reusable Buzz voice primitives refactor(desktop): extract reusable Buzz voice primitives Jul 27, 2026
@johnmatthewtennant johnmatthewtennant changed the title refactor(desktop): extract reusable Buzz voice primitives refactor(desktop): extract reusable Pocket voice primitives Jul 27, 2026
Comment thread crates/buzz-voice/src/pocket.rs Outdated
@@ -0,0 +1,654 @@
//! Pocket TTS engine wrapper around sherpa-onnx's `OfflineTts`.

@johnmatthewtennant johnmatthewtennant Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 pocket.rs is a code relocation, not a whole-file rename. The exact 166-line implementation from the Desktop file is copied here byte-for-byte; the old Desktop path is replaced with a four-line compatibility re-export.

To verify:

diff -u \
  <(git show 43361508c3de49a58672ebb4a1232a05c2e16e35:desktop/src-tauri/src/huddle/pocket.rs) \
  <(git show b6daac775a33eaad35fa83114e1c69402bcb3e25:crates/buzz-voice/src/pocket.rs)
echo "exit=$?"

Observed output:

exit=0

The empty diff proves the implementation is unchanged. pocket_april.rs and pocket_models.rs are separate whole-file 100% renames.

@johnmatthewtennant johnmatthewtennant changed the title refactor(desktop): extract reusable Pocket voice primitives refactor(voice): extract reusable Pocket voice primitives Jul 28, 2026
@johnmatthewtennant
johnmatthewtennant force-pushed the jt/buzz-voice-refactor branch 2 times, most recently from a3c16e7 to 0f97b7e Compare July 28, 2026 14:30
@johnmatthewtennant johnmatthewtennant changed the title refactor(voice): extract reusable Pocket voice primitives refactor(voice): extract reusable Pocket primitives Jul 28, 2026
@johnmatthewtennant
johnmatthewtennant changed the base branch from main to jtennant/pocket-tts-2026-04 July 28, 2026 19:18

Copy link
Copy Markdown
Contributor Author

🤖 Fresh CI bookkeeping for exact slim head b6daac775a33eaad35fa83114e1c69402bcb3e25:

  • Block DCO Check: passed.
  • CI workflow: SUCCESS. Rust lint, unit tests, Desktop core/build/smoke/E2E, security, Windows Rust, both Linux cross-compiles, backend integration, and relay E2E passed. Web and Mobile were path-skipped as expected.
  • Docker workflow: all four PR image builds passed (relay amd64/arm64 and public push gateway amd64/arm64); manifest publication jobs were skipped as expected for a pull request.
  • Canonical personal-fork ref, block mirror, PR REST head, and refs/pull/2467/head all resolve to this exact SHA.

No readiness or merge action was taken; the PR remains OPEN+DRAFT.

@johnmatthewtennant
johnmatthewtennant marked this pull request as ready for review July 28, 2026 20:23
@johnmatthewtennant
johnmatthewtennant requested a review from a team as a code owner July 28, 2026 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant